package model;
// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Tinventory entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tinventory", catalog = "test")
public class Tinventory implements java.io.Serializable {

	// Fields

	private String id;
	private Tgood tgood;
	private Integer originalsum;
	private Integer amount;

	// Constructors

	/** default constructor */
	public Tinventory() {
	}

	/** minimal constructor */
	public Tinventory(String id) {
		this.id = id;
	}

	/** full constructor */
	public Tinventory(String id, Tgood tgood, Integer originalsum, Integer amount) {
		this.id = id;
		this.tgood = tgood;
		this.originalsum = originalsum;
		this.amount = amount;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "goodid")
	public Tgood getTgood() {
		return this.tgood;
	}

	public void setTgood(Tgood tgood) {
		this.tgood = tgood;
	}

	@Column(name = "originalsum")
	public Integer getOriginalsum() {
		return this.originalsum;
	}

	public void setOriginalsum(Integer originalsum) {
		this.originalsum = originalsum;
	}

	@Column(name = "amount")
	public Integer getAmount() {
		return this.amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

}